package edu.nf.ch10;

import edu.nf.ch10.config.AppConfig;
import edu.nf.ch10.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author wangl
 * @date 2025/4/30
 */
public class Main {

    public static void main(String[] args) {
        //使用AnnotationConfigApplicationContext这个容器来初始化配置类
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        UserService userService = context.getBean(UserService.class);
        userService.add();
    }
}